const { list, remove, add } = require('./data/support-return-money-shop')

const base = '/operation'

module.exports = [{
  url: `${base}/supportReturnMoneyShop`,
  type: 'get',
  response: config => {
    const { page, limit, orgUnitId } = config.query
    return list(page, limit, orgUnitId)
  }
}, {
  url: `${base}/supportReturnMoneyShop`,
  type: 'post',
  response: config => {
    add(config.body)
    return { success: true }
  }
}, {
  url: `${base}/supportReturnMoneyShop/[1-9][0-9]*`,
  type: 'delete',
  response: config => {
    const id = config.url.match(/[1-9][0-9]*/)
    remove(id)
    return { success: true }
  }
}]
